package com.foreknow.oppTest1;

import java.util.Scanner;

/**
 * @author shkstart
 * @create 2021-07-23 15:39
 */
public class User {
    Scanner sc=new Scanner(System.in);
    private String name;
    String[] s ;
    public User() {
        s=new String[3];
        s[0]="剪刀";
        s[1]="石头";
        s[2]="布";
    }

    /**
     * 用户出拳
     */
    public int showFirst(){
        System.out.println("请出拳1.剪刀 2.石头 3.布(输入相应的数字)");
        int chuquan = sc.nextInt();
        boolean f1=true;
        while (f1) {
            if(chuquan>=1||chuquan<=3){
                f1=false;
            }else {
                System.out.println("输入错误请重新输入");
            }
        }
        System.out.println("你出拳"+new User().s[chuquan-1]);
        return chuquan;
    }


}
